2020-2021 Sunseeker Telemetry and Lighting System
tlv_ex3_calibrateTempSensor.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Functions

void calibrateADC (void)
 
void main (void)
 
void ADC12ISR (void)
 

Variables

uint16_t temp
 
volatile float DegF
 
volatile float DegC
 
float mref
 
float nref
 
uint8_t bADCCAL_bytes
 
struct s_TLV_ADC_Cal_Data * pADCCAL
 

Function Documentation

◆ ADC12ISR()

void ADC12ISR ( void  )

Definition at line 215 of file tlv_ex3_calibrateTempSensor.c.

References __bic_SR_register_on_exit(), and temp.

◆ calibrateADC()

void calibrateADC ( void  )

Definition at line 127 of file tlv_ex3_calibrateTempSensor.c.

References bADCCAL_bytes, mref, nref, and pADCCAL.

◆ main()

void main ( void  )

Definition at line 93 of file tlv_ex3_calibrateTempSensor.c.

References __no_operation(), calibrateADC(), DegC, DegF, mref, nref, and temp.

Variable Documentation

◆ bADCCAL_bytes

uint8_t bADCCAL_bytes

Definition at line 78 of file tlv_ex3_calibrateTempSensor.c.

◆ DegC

volatile float DegC

Definition at line 76 of file tlv_ex3_calibrateTempSensor.c.

◆ DegF

volatile float DegF

Definition at line 75 of file tlv_ex3_calibrateTempSensor.c.

◆ mref

float mref

Definition at line 77 of file tlv_ex3_calibrateTempSensor.c.

◆ nref

float nref

Definition at line 77 of file tlv_ex3_calibrateTempSensor.c.

◆ pADCCAL

struct s_TLV_ADC_Cal_Data* pADCCAL

Definition at line 79 of file tlv_ex3_calibrateTempSensor.c.

◆ temp

uint16_t temp

TLV - Sample Calibrated A30 Internal Temp Sensor as Input, AVcc Ref

After initialization, the the calibration constants for the unit are read in through the TLV. A single sample is made on A30 with reference to internal 1.2V Vref. Software sets ADC12SC to start sample and conversion - ADC12SC automatically cleared at EOC. ADC12 internal oscillator times sample and conversion. In Mainloop MSP430 waits in LPM4 to save power until ADC12 conversion complete, ADC12_B_ISR will force exit from any LPMx in Mainloop on reti.

The results of the temperature sense can be viewed in the watch window by watching the variables DegC and DegF

ACLK = n/a, MCLK = SMCLK = default DCO ~ 1.045MHz, ADC12CLK = ADC12OSC

           MSP430FR5969
        -----------------
    /|\|                 |
     | |                 |
     --|RST              |
       |Temp Sensor-->A30|
       |                 |

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • ADC12 peripheral
  • A30(TempSensor)

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • ADC12_B_VECTOR

Definition at line 74 of file tlv_ex3_calibrateTempSensor.c.